using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using WEB.BLL.Entities;
using WEB.Exceptions;
namespace WEB.BLL.Services
{
	#region DesktopService

	/// <summary>
	/// DesktopService object for Ibatis mapped table 'Desktop'.
	/// </summary>
	public class DesktopService : IDesktopService
	{
		private static readonly ILog log = LogManager.GetLogger(typeof(DesktopService).Name);
	  	private static volatile DesktopService _DesktopService = null;
        public static DesktopService GetInstance()
        {
            if (_DesktopService == null)
            {
                lock (typeof(DesktopService))
                {
                    if (_DesktopService == null) // double-check
                        _DesktopService = new DesktopService();
                }
            }
            return _DesktopService;
        }
		public DesktopService()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public IList<DesktopEntity> LoadScreenAll()
        {
            try
            {
                return ExecuteQueryForList<DesktopEntity>("DesktopLoadScreenAll", null);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
        public DesktopEntity LoadByPrimaryScreen(DesktopEntity objE)
        {
            try
            {
                return ExecuteQueryForObject<DesktopEntity>("DesktopLoadByScreen", objE);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
	}
	#endregion  
}
